package org.jeecg.modules.order.service;

import org.jeecg.modules.order.entity.MtRepairDispatch;
import org.jeecg.modules.order.entity.MtRepairEquip;
import org.jeecg.modules.order.entity.MtRepairSchedule;
import org.jeecg.modules.order.entity.MtRepairFeedback;
import org.jeecg.modules.order.entity.MtRepairDispose;
import org.jeecg.modules.order.entity.MtRepairOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.order.vo.MtRepairOrderPage;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 工单表
 * @Author: jeecg-boot
 * @Date: 2022-09-26
 * @Version: V1.0
 */
public interface IMtRepairOrderService extends IService<MtRepairOrder> {

    /**
     * 添加一对多
     *
     * @param mtRepairOrder
     * @param mtRepairDispatchList
     * @param mtRepairEquipList
     * @param mtRepairScheduleList
     * @param mtRepairFeedbackList
     * @param mtRepairDisposeList
     */
    public void saveMain(MtRepairOrder mtRepairOrder, List<MtRepairDispatch> mtRepairDispatchList, List<MtRepairEquip> mtRepairEquipList, List<MtRepairSchedule> mtRepairScheduleList, List<MtRepairFeedback> mtRepairFeedbackList, List<MtRepairDispose> mtRepairDisposeList);

    /**
     * 修改一对多
     *
     * @param mtRepairOrder
     * @param mtRepairDispatchList
     * @param mtRepairEquipList
     * @param mtRepairScheduleList
     * @param mtRepairFeedbackList
     * @param mtRepairDisposeList
     */
    public void updateMain(MtRepairOrder mtRepairOrder, List<MtRepairDispatch> mtRepairDispatchList, List<MtRepairEquip> mtRepairEquipList, List<MtRepairSchedule> mtRepairScheduleList, List<MtRepairFeedback> mtRepairFeedbackList, List<MtRepairDispose> mtRepairDisposeList);

    /**
     * 删除一对多
     *
     * @param id
     */
    public void delMain(String id);

    /**
     * 批量删除一对多
     *
     * @param idList
     */
    public void delBatchMain(Collection<? extends Serializable> idList);

    /**
     * 根据工程师id获取未完成工单
     *
     * @param engineerId
     * @return List<MtRepairOrder>
     */
    List<MtRepairOrder> getProcessingListByEngineer(String engineerId);

    /**
     * 自动派工
     *
     * @param mtRepairOrder    订单
     * @param mtRepairDispatch 订单派工记录
     * @param mtRepairSchedule 订单进度跟踪
     */
    void repairOrderDispatch(MtRepairOrder mtRepairOrder, MtRepairDispatch mtRepairDispatch, MtRepairSchedule mtRepairSchedule);

    /**
     * 业务流程更新
     *
     * @param mtRepairOrderPage
     */
    void updateByWork(MtRepairOrderPage mtRepairOrderPage);

    /**
     * 撤回派工
     *
     * @param mtRepairOrderPage 工单
     * @param deleteDispatch    撤回工程师列表
     */
    void repairOrderCancelDispatch(MtRepairOrderPage mtRepairOrderPage, List<MtRepairDispatch> deleteDispatch);
}
